package practice.demo.queue;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @ClassName: GetPath
 * @Description: TODO
 * @author YuanMingjie
 * @date May 27, 2020 10:40:10 PM
 * 
 */
public class GetPath {

	public static List<String> getFile(String path) {
		List<String> list = new ArrayList<String>();
		// get file list where the path has
		File file = new File(path);
		// get the folder list
		File[] array = file.listFiles();
		for (int i = 0; i < array.length; i++) {
			if (array[i].isFile()) {

				System.out.println(array[i].getPath());
				list.add(array[i].getPath());

			} else if (array[i].isDirectory()) {
				getFile(array[i].getPath());
			}
		}
		return list;

	}
}